<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
    <script src="js/vue.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>
<div id="t">
    <button value="登陆" @click="login2()">登陆2</button>
    <button value="登陆" @click="login4()">登陆4</button>
</div>
<script>
    var t = new Vue({
        el: "#t",
        data: {
            fromData:{
                username: "QQQ",
                password: "QQQ",
            },
            fromData2:{
                username: "QQQ2",
                password: "QQQ",
            },
        },
        methods: {
            login2() {
                axios.post("http://localhost:8889/api/employees/login", this.fromData).then((res) => {
                    if(res.data.flag && res.data.data != null) {
                        console.log(res.data.msg);
                    } else {
                        console.log(res.data.msg);
                    }
                });
            },
            login4() {
                axios.post("http://localhost:8889/api/employees/login", this.fromData2).then((res) => {
                    if(res.data.flag && res.data.data != null) {
                        console.log(res.data.msg);
                    } else {
                        console.log(res.data.msg);
                    }
                });
            }
        }
    })
</script>
</body>
</html>
